#include "testeventloop.h"

#include "qpushbutton.h"
#include "qeventloop.h"

testeventloop::testeventloop(QWidget *parent)
    : QMainWindow(parent)
{
    ui.setupUi(this);
    QPushButton* _btn = new QPushButton(this);
    connect(_btn, &QPushButton::clicked, this, &testeventloop::OnClicked);
}

void testeventloop::OnClicked()
{
    do
    {
        static int a = 0;
        if (100 < a)
            break;
        QCoreApplication::processEvents();
    } while (true);
}